package com.whfc.common.result;

/**
 * @author guodong_sun
 * @Description:
 * @date 2019年7月18日
 */
@Deprecated
public class ResultUtil {

    public static Result success() {
        return new Result(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMessage());
    }

    public static Result success(String code, Object object) {
        Result result = new Result(code, ResultEnum.SUCCESS.getMessage());
        result.setData(object);
        return result;
    }

    public static Result success(Object object) {
        Result result = new Result(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMessage());
        result.setData(object);
        return result;
    }

    public static Result failure() {
        return new Result(ResultEnum.FAILURE.getCode(), ResultEnum.FAILURE.getMessage());
    }


    public static Result failure(Object object) {
        Result result = new Result(ResultEnum.FAILURE.getCode(), ResultEnum.FAILURE.getMessage());
        result.setData(object);
        return result;
    }

    public static Result paramError() {
        return new Result(ResultEnum.PARAM_ERROR.getCode(), ResultEnum.PARAM_ERROR.getMessage());
    }


    public static Result paramError(Object object) {
        Result result = new Result(ResultEnum.PARAM_ERROR.getCode(), ResultEnum.PARAM_ERROR.getMessage());
        result.setData(object);
        return result;
    }


    public static Result authError() {
        return new Result(ResultEnum.AUTHZ_ERROR.getCode(), ResultEnum.AUTHZ_ERROR.getMessage());
    }


    public static Result authError(Object object) {
        Result result = new Result(ResultEnum.AUTHZ_ERROR.getCode(), ResultEnum.AUTHZ_ERROR.getMessage());
        result.setData(object);
        return result;
    }

    public static Result tokenExpired() {
        return new Result(ResultEnum.TOKEN_EXPIRED.getCode(), ResultEnum.TOKEN_EXPIRED.getMessage());
    }


    public static Result unknownError() {
        return new Result(ResultEnum.UNKNOWN_ERROR.getCode(), ResultEnum.UNKNOWN_ERROR.getMessage());
    }


    public static Result unknownError(Object object) {
        Result result = new Result(ResultEnum.UNKNOWN_ERROR.getCode(), ResultEnum.UNKNOWN_ERROR.getMessage());
        result.setData(object);
        return result;
    }
}
